package com.sy.pet.config.excetion;

import com.sy.pet.commom.enmu.ResponseCode;

/**
 * @Author: liangSY
 * @Date: 2021/7/15
 * @ClassName: ServiceExcetion
 * @Description: 服务异常
 */
public class ServiceExcetion extends RuntimeException {

    private int code;

    public ServiceExcetion(int code) {
        this.code = code;
    }

    public ServiceExcetion(ResponseCode responseCode) {
        new ServiceExcetion(responseCode.getCode(),responseCode.getMessage());
    }

    public ServiceExcetion(int code, String message) {
        super(message.toString());
        this.code = code;
    }

    public int getCode() {
        return this.code;
    }

}
